GtkColorSwatch: Avoid style context underflow
authorMatthias Clasen <mclasen@redhat.com>
Sun, 12 Oct 2014 22:15:23 +0000 (18:15 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 12 Oct 2014 22:15:23 +0000 (18:15 -0400)
The last change accidentally removed the later restore, and
left the earlier, so we ended up with a restore-save sequence.
Thankfully, GtkStyleContext warns about this.

gtk/gtkcolorswatch.c

index a88ce466244b7249e954e4c0e359009048323d6e..b3459a7c169feb748c761a12e5b580c40b96aa0d 100644 (file)
@@ -183,8 +183,6 @@ swatch_draw (GtkWidget *widget,
       g_object_unref (gicon);
     }
 
-  gtk_style_context_restore (context);
-
   /* now draw the overlay image */
   gtk_style_context_get_border (context, state, &border);
   gtk_style_context_get_padding (context, state, &padding);
@@ -222,6 +220,8 @@ swatch_draw (GtkWidget *widget,
       gtk_render_focus (context, cr, 0, 0, width, height);
     }
 
+  gtk_style_context_restore (context);
+
   return FALSE;
 }